#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
	FILE *fp;
	char a[20];
	if((fp=fopen("a.txt","w"))==NULL)
	{
		exit(0);
	}
	while(strlen(gets(a))>0)
	{
		fputs(a,fp);
		fputs("\n",fp);
	}
	fclose(fp);
	if((fp=fopen("a.txt","r"))==NULL)
	{
		exit(0);
	}
	while(fgets(a,20,fp)!=NULL)
	printf("%s",a);
	fclose(fp);
 } 
